<template>
		<section>
			<ads-index v-if='adsIndex == 0'/>
			<ads-video v-if='adsIndex == 1'/>
			<ads-audience v-if='adsIndex == 2'/>
		</section>
	    	
</template>
<script>
  import Vue from 'vue'
	import {Tabs,TabPane} from 'element-ui';
	import AdsIndex from '~/components/adv-assets/index.vue'
	import AdsVideo from '~/components/adv-assets/video.vue'
	import AdsAudience from '~/components/adv-assets/Audience.vue'
  import { changeParam, getParam} from '~/assets/js/global'
  import { mapGetters} from 'vuex';
  import { ADS_INDEX } from '../../../store/mutation-types/adv-assets/index.js'
	Vue.use(Tabs);
	Vue.use(TabPane);
  export default {
    data() {
      return {
      };
    },
    head(){
        return{
            title: 'ADS-广告资产'
        }
    },
    watch: {
    	$route:function () {
    	    this.changeTabs();
    	}
    },
    computed : {
        adsIndex() {
          return this.$store.state.advAssets.adsIndex
        }
    },
    components: {
        AdsIndex,
        AdsVideo,
        AdsAudience,
    },
    methods: {
      changeTabs(){
          let url = window.location.href;
          url = url.substring(url.lastIndexOf("/"));
          this.index = url.charAt(1);    
      }
    },
    mounted() {
      
    }
  };
</script>
<style lang="scss">
	.ads-header {
		margin: 0;
		background-color: #fff;
		font-size: 16px;
	}
	.el-tabs__header{
		margin: 0 !important;
	}
</style>